package com.lizemin.controller;

import com.lizemin.entity.UserInfo;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.*;

@RestController
@Slf4j
public class TestController {

    @GetMapping("/heartBeat")
    public String heartBeat() {
        return "ok";
    }

    @GetMapping("/getUserName")
    public String getUserName( Integer id) {
        return "哈利波特";
    }

    @GetMapping("/getUserInfo")
    public String getUserInfo(String name, String age) {
        return String.format("您的姓名是：%s, 年龄是：%s", name, age);
    }

    @PostMapping("/getUser")
    public UserInfo getUser(@RequestBody UserInfo userInfo) {
        log.info("开始查询用户信息");
        return userInfo;
    }

}
